const article = {
    initRoute (router, controller) {
        router
            // 获取文章
            .get('/article', controller.getArticle)
            .get('/article/count', controller.getArticleCount)
            .get('/article/hot', controller.getHotArticle)
            .get('/article/top', controller.getTopArticle)
            // 获取不同分类下所有文章的数量
            .get('/article/category/count', controller.getArticleCountUnderCategory)
            // 添加文章 批量添加
            .post('/article', controller.createArticle)
            .post('/article/likes', controller.updateArticleLikes)
            .post('/article/comment', controller.updateArticleComment)
            // 编辑一个文章
            .post('/article/:id', controller.updateOneArticle)
            // 批量删除
            .del('/article', controller.deleteArticle)
    },
}

module.exports = article
